import 'package:manager/configs/app_data.dart';
import 'package:dio/dio.dart';
import 'app_exceptions.dart';

class TokenInterceptor extends Interceptor {

  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    if(AppData.accessToken.isNotEmpty){
      options.headers['Authorization']='Bearer ${AppData.accessToken}';
    }
    super.onRequest(options, handler);
  }
}
